// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_SYS_WORKING_PERIOD
// * CreateDate    : 2014-06-05 20:11:01
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 20:11:01
// * LastChanger   : 2014-06-05 20:11:01
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
    [Serializable]
    public partial class SysWorkingPeriodEntity : EntityBase
    {
        public SysWorkingPeriodTable TableSchema
        {
            get
            {
                return SysWorkingPeriodTable.Current;
            }
        }

        public SysWorkingPeriodEntity()
        {

        }

        public SysWorkingPeriodEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
            this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
            this.TimeFrom = Convert.ToDateTime(CommonFunctions.ToObject(dr["TIME_FROM"]));
            this.TimeTo = Convert.ToDateTime(CommonFunctions.ToObject(dr["TIME_TO"]));
            this.ExcutingTime = Convert.ToDecimal(CommonFunctions.ToObject(dr["EXCUTING_TIME"]));
            this.PeriodId = Convert.ToString(CommonFunctions.ToObject(dr["PERIOD_ID"]));
            this.ShiftType = Convert.ToString(CommonFunctions.ToObject(dr["SHIFT_TYPE"]));
        }

        public SysWorkingPeriodEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
            this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
            this.TimeFrom = Convert.ToDateTime(CommonFunctions.ToObject(dr["TIME_FROM"]));
            this.TimeTo = Convert.ToDateTime(CommonFunctions.ToObject(dr["TIME_TO"]));
            this.ExcutingTime = Convert.ToDecimal(CommonFunctions.ToObject(dr["EXCUTING_TIME"]));
            this.PeriodId = Convert.ToString(CommonFunctions.ToObject(dr["PERIOD_ID"]));
            this.ShiftType = Convert.ToString(CommonFunctions.ToObject(dr["SHIFT_TYPE"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return SysWorkingPeriodTable.Current;
            }
        }

        #region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(SysWorkingPeriodTable.C_ID)); }
            set { SetData(SysWorkingPeriodTable.C_ID, value); }
        }

        [DataMember]
        public int IsActive
        {
            get { return Convert.ToInt32(GetData(SysWorkingPeriodTable.C_IS_ACTIVE)); }
            set { SetData(SysWorkingPeriodTable.C_IS_ACTIVE, value); }
        }

        [DataMember]
        public DateTime TimeFrom
        {
            get { return Convert.ToDateTime(GetData(SysWorkingPeriodTable.C_TIME_FROM)); }
            set { SetData(SysWorkingPeriodTable.C_TIME_FROM, value); }
        }

        [DataMember]
        public DateTime TimeTo
        {
            get { return Convert.ToDateTime(GetData(SysWorkingPeriodTable.C_TIME_TO)); }
            set { SetData(SysWorkingPeriodTable.C_TIME_TO, value); }
        }

        [DataMember]
        public decimal ExcutingTime
        {
            get { return Convert.ToDecimal(GetData(SysWorkingPeriodTable.C_EXCUTING_TIME)); }
            set { SetData(SysWorkingPeriodTable.C_EXCUTING_TIME, value); }
        }

        [DataMember]
        public string PeriodId
        {
            get { return Convert.ToString(GetData(SysWorkingPeriodTable.C_PERIOD_ID)); }
            set { SetData(SysWorkingPeriodTable.C_PERIOD_ID, value); }
        }

        [DataMember]
        public string ShiftType
        {
            get { return Convert.ToString(GetData(SysWorkingPeriodTable.C_SHIFT_TYPE)); }
            set { SetData(SysWorkingPeriodTable.C_SHIFT_TYPE, value); }
        }

        #endregion
    }


}

